<template>
    <div>
      <el-card>
        <div class="coll_title">销售业绩</div>
        <div>
          <el-form :model="form" label-width="auto" class="ddisp">
            <div>
              <el-form-item label="名称 :">
                <el-input v-model="form.name" />
              </el-form-item>
            </div>
            <div class="mag_l-10">
              <el-form-item label="时间 :">
                <el-date-picker
                    v-model="value2"
                    type="daterange"
                    unlink-panels
                    range-separator="To"
                    start-placeholder="Start date"
                    end-placeholder="End date"
                    :shortcuts="shortcuts"
                    :size="size"
                />
              </el-form-item>
            </div>
            <div class="mag_l-10 ">
              <el-button class="centerdq" type="primary">查询</el-button>
            </div>
          </el-form>
        </div>
      </el-card>
      <el-card shadow="always" class="mag_t-20">
        <div class="coll_title">订单列表</div>
        <div>
          <el-table v-if="tableData" :data="tableData" :border="true">
            <el-table-column type="selection" width="40" />
            <el-table-column prop="id" label="ID" width="50" />
            <el-table-column prop="name" label="名称" width="100" />
            <el-table-column prop="age" label="单价" width="100" />
            <el-table-column prop="sum" label="重量(斤)" width="100" />
            <el-table-column prop="money" label="总价" width="100" />
            <el-table-column prop="profit_age" label="利润" width="100" />
            <el-table-column prop="source_name" label="来源" width="100" />
            <el-table-column prop="createtime" label="时间" width="220" />
            <el-table-column label="操作" min-width="120">
              <template #default>
                <el-button type="primary">查看</el-button>
                <el-button type="primary" @click="handleClick">编辑</el-button>
                <el-button type="danger">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div>
          <div class="demo-pagination-block pad_t_20">
            <el-pagination
                v-model:current-page="currentPage4"
                v-model:page-size="pageSize4"
                :page-sizes="[10, 20, 30, 100]"
                :size="size"
                :disabled="disabled"
                :background="true"
                layout="total, sizes, prev, pager, next, jumper"
                :total="40"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
            />
          </div>
        </div>
      </el-card>
    </div>
</template>
<script setup lang="ts">
import {onMounted, ref} from "vue";
import {order} from "@/api";
const form = ref({})

onMounted(() => {
  getOrder_lisy(); // 默认执行 initChart 方法
});
let tableData = ref([])
const handleClick = ()=>{}
const getOrder_lisy = async ()=>{

  const res:any = await order.getOrderList({
    page: 1,
    limit: 10,
  })
  tableData.value = res.data.data.data
  console.log("订单列表",tableData)
}
</script>
<style scoped>

</style>
